<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">

    <title>一个简单的留言墙</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js "></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/js-base64@3.6.0/base64.min.js"></script>
    　<script language="JavaScript">

    function openwin() {
        var aurl = document.getElementsByClassName('aurl');
        var trlist = document.getElementsByTagName('tr');
        for(let i = 0;i<trlist.length;i++){
            trlist[i].onclick = function(){
                console.log(aurl[i-1].href);
                window.open('http://8.136.135.118:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(aurl[i-1])));
            }

        }
    }


        </script>
</head>
<body background="/fj1.png" >
<div align="left">
    <table border="1" class="table   table-bordered table-condensed table-hover">
        <tr>
            <th>用户名</th>
            <th>文件名</th>
            <th>文件描述</th>
            <th>文件大小</th>
            <th>上传时间</th>
            <th>下载</th>
            <th>预览</th>
            <th>删除</th>
        </tr>
        <label style="color: #ff0000" th:text="${name1}"></label>
        <tr th:each="wenjian:${wenjians}">
            <td th:text="${wenjian.name}"></td>
            <td th:text="${wenjian.wenName}"></td>
            <td th:text="${wenjian.dec}"></td>
            <td th:text="${wenjian.size}"></td>
            <td th:text="${#dates.format(wenjian.date,'yyyy-MM-dd hh:mm:ss')}"></td>
            <td ><a class="aurl" th:href="${wenjian.wenUrl}" >下载</a></td>
            <td><a href="#" onclick = "openwin(event)">预览</a></td>
            <td ><a th:href="'/deleteOne?wid='+${wenjian.wid}">删除</a></td>
        </tr>
    </table>

    <!--分页-->
    <div class="modal-footer no-margin-top">
        <div class="col-md-6 col-xs-8 col-xs-offset-1">
            当前第 [[${pageInfo.pageNum}]]页，共 [[${pageInfo.pages}]] 页， 共 [[${pageInfo.total}]] 条记录
        </div>

        <ul class="pagination pull-right no-margin">
            <li>
                <a th:href="'/queryByName?pageNum=1'+'&name='+${name1}">首页</a>
            </li>
            <li class="prev" th:if="${pageInfo.hasPreviousPage}">
                <a th:href="'/queryByName?pageNum='+${pageInfo.prePage}+'&name='+${name1}">
                    上一页<i class="ace-icon fa fa-angle-double-left"></i>
                </a>
            </li>
            <!--遍历条数-->
            <li th:each="nav:${pageInfo.navigatepageNums}">
                <a th:href="'/queryByName?pageNum='+${nav}+'&name='+${name1}" th:text="${nav}" th:if="${nav != pageInfo.pageNum}"></a>
                <span style="font-weight: bold;background: #6faed9;" th:if="${nav == pageInfo.pageNum}" th:text="${nav}" ></span>
            </li>

            <li class="next" th:if="${pageInfo.hasNextPage}">
                <a th:href="'/queryByName?pageNum='+${pageInfo.nextPage}+'&name='+${name1}">
                    下一页<i class="ace-icon fa fa-angle-double-right"></i>
                </a>
            </li>
            <li>
                <!--/*@thymesVar id="pageInfo" type=""*/-->
                <a th:href="'/queryByName?pageNum='+${pageInfo.pages}+'&name='+${name1}">尾页</a>
            </li>
        </ul>

    </div>
</div>
<div style="width:600px;margin:0 auto; padding:20px 0;">
    <a target="_blank" href="https://beian.miit.gov.cn/#/Integrated/recordQuery" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;">
        <img src="" style="float:left;"/>
        <p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">陕ICP备2021004202号-1</p></a>
</div>

</body>

</html>
